import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  //一级路由
  routes: [
    {
      path: '/layout',
      name: 'layout',
      component: () => import('../views/layout/indexView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/indexView.vue'),
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('../views/register/indexView.vue'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('../views/403/indexView.vue'),
    },
    {
      path: '/404',
      name: '404',
      component: () => import('../views/404/indexView.vue'),
    },
    //重定向
    {
       path: '/:pathMatch(.*)*',
       redirect: '/404'
    },
  ],
})

export default router
